package edu.whut.mall.pojo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import edu.whut.mall.common.enums.ProductFileType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
/**
 * Author: smq
 * Unit: D9lab
 * Date: 2021-06-07 16:15
 */
@Data
@Builder
@AllArgsConstructor
public class ProductFile implements Serializable {
    private static final long serialVersionUID = 8;

    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer file;
    private Integer fileThumb;
    private Integer productId;
    private Date createTime;
    private Date updateTime;
    private Boolean isDeleted;
    private String specification;
    private Integer index1;
    private ProductFileType type;

    public ProductFile() {
    }

    public ProductFile(int file, int fileThumb, int productId, ProductFileType type) {
        this.file = file;
        this.fileThumb = fileThumb;
        this.productId = productId;
        this.type = type;
        this.createTime = new Date();
        this.updateTime = new Date();
        this.isDeleted = false;
        this.index1 = 0;
    }
}